﻿<phone:PhoneApplicationPage 
  x:Class="Renren.Pages.UserPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
  mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
  FontSize="{StaticResource PhoneFontSizeNormal}"
  Foreground="{StaticResource PhoneForegroundBrush}"
  SupportedOrientations="Portrait"  Orientation="Portrait"
  shell:SystemTray.IsVisible="False"
  
  d:DataContext="{d:DesignData /SampleData/UserPageViewModel.xaml}"
  xmlns:local="clr-namespace:Utils.UIEffect"
  xmlns:renren="clr-namespace:Renren.Controls"
  local:TiltEffect.IsTiltEnabled="True">

  <!--LayoutRoot is the root grid where all page content is placed-->
  <Grid x:Name="LayoutRoot" Background="Transparent" Margin="0,32,0,0">

    <renren:TitleBlock Source="/Images/user.png"
                            Text="{Binding UserView.User.Name}"
                            Margin="20,0"
                            VerticalAlignment="Top" />
    
    <!--Pivot Control-->
    <controls:Pivot Title=" ">
      
      <!--Profile Pivot-->
      <controls:PivotItem Header="资料">
        <ListBox>
          <ListBoxItem>
            <StackPanel Orientation="Horizontal" Height="200"
                        HorizontalAlignment="Left" VerticalAlignment="Top">
              <Grid Width="200" Margin="12,0,8,0">
                <Image Source="{Binding UserView.User.MainUrl}"
                       Stretch="UniformToFill"
                       HorizontalAlignment="Center" VerticalAlignment="Center" />
              </Grid>
              <StackPanel>
                <TextBlock Text="{Binding UserView.User.Name}"
                           Style="{StaticResource PhoneTextExtraLargeStyle}" />
                <TextBlock Text="{Binding UserView.StatusTime}"
                           Style="{StaticResource PhoneTextSubtleStyle}" />
                <TextBlock Text="{Binding UserView.StatusContent}"
                           Width="212" TextWrapping="Wrap" 
                           HorizontalAlignment="Left"
                           Style="{StaticResource PhoneTextNormalStyle}" />
              </StackPanel>
            </StackPanel>
          </ListBoxItem>
          <ListBoxItem Margin="0,12,0,0">
            <StackPanel>
              <TextBlock Text="生日"
                           Style="{StaticResource PhoneTextLargeStyle}" />
              <TextBlock Text="{Binding UserView.Birthday}"
                           Style="{StaticResource PhoneTextAccentStyle}" />
            </StackPanel>
          </ListBoxItem>
          <ListBoxItem Margin="0,12,0,0">
            <StackPanel>
              <TextBlock Text="家乡"
                           Style="{StaticResource PhoneTextLargeStyle}" />
              <TextBlock Text="{Binding UserView.Hometown}"
                           Style="{StaticResource PhoneTextAccentStyle}" />
            </StackPanel>
          </ListBoxItem>
        </ListBox>
      </controls:PivotItem>

      <controls:PivotItem Header="新鲜事">
        <renren:StreamBox x:Name="NewsStreamBox" ItemsSource="{Binding NewsList}"
                          TailIdleText="更多新鲜事">
          <renren:StreamBox.ItemTemplate>
            <DataTemplate>
              <renren:NewsBox Margin="0,0,0,20" />
            </DataTemplate>
          </renren:StreamBox.ItemTemplate>
        </renren:StreamBox>
      </controls:PivotItem>
      
    </controls:Pivot>
  </Grid>

  <!--Sample code showing usage of ApplicationBar-->
  <!--<phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
      <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Button 1"/>
      <shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Button 2"/>
      <shell:ApplicationBar.MenuItems>
        <shell:ApplicationBarMenuItem x:Name="menuItem1" Text="MenuItem 1"/>
        <shell:ApplicationBarMenuItem x:Name="menuItem2" Text="MenuItem 2"/>
      </shell:ApplicationBar.MenuItems>
    </shell:ApplicationBar>
  </phone:PhoneApplicationPage.ApplicationBar>-->
    
</phone:PhoneApplicationPage>